﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Analyzer
{
    public static class ItemsControlBehaviour
    {
        public static readonly DependencyProperty SelectCommand =
            EventBehaviourFactory.CreateCommandExecutionEventBehaviour(
                ItemsControl.MouseLeftButtonDownEvent,
                "SelectCommand",
                typeof(ItemsControlBehaviour)
            );

        public static void SetSelectCommand(DependencyObject o, ICommand value)
        {
            o.SetValue(SelectCommand, value);
        }

        public static ICommand GetSelectCommand(DependencyObject o)
        {
            return o.GetValue(SelectCommand) as ICommand;
        }
    }
}
